package com;

import java.io.FileOutputStream;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;

public class SecondClass {

	public void testWrite(String filepath){
		try{
			FileOutputStream output = new FileOutputStream(filepath);
			FileChannel fout = output.getChannel();
			ByteBuffer buffer = ByteBuffer.allocate(1024);
			
			Byte [] message = {'a','b','c'};
			
			for(int i = 0; i < message.length; i++){
				buffer.put(message[i]);
			}
			buffer.flip();
			fout.write(buffer);
			
		}catch (Exception e) {
			e.printStackTrace();
		}
	}
}
